package com.lzqinga.model;

import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * - @author lzqinga
 * - @description
 * - @date 2025/10/11/011 11:58
 **/
@Data
public class VideoComposeRequest {
    @NotEmpty(message = "视频片段不能为空")
    private List<VideoSegmentRequest> segments;

    private VideoConfig config;

    @Data
    public static class VideoSegmentRequest {
        @NotNull(message = "图片不能为空")
        private MultipartFile image;

        @NotNull(message = "音频不能为空")
        private MultipartFile audio;

        private Double duration; // 片段时长（秒），如果为空则使用音频时长

        private String subtitle; // 字幕文本

        // 转场效果
        private String transition = "fade";
        private Double transitionDuration = 1.0;
    }

    @Data
    public static class VideoConfig {
        private Integer width = 1920;
        private Integer height = 1080;
        private Integer fps = 25;
        private String outputFormat = "mp4";

        // 全局转场配置
        private Boolean enableTransitions = true;
        private Double transitionDuration = 1.0;

        // 背景音乐
        private MultipartFile backgroundMusic;
        private Double backgroundMusicVolume = 0.3;

        // 字幕配置
        private Boolean enableSubtitles = true;
        private Integer subtitleFontSize = 48;
        private String subtitleFontColor = "#FFFFFF";
        private String subtitleStrokeColor = "#000000";
        private Integer subtitleStrokeWidth = 2;
    }
}
